
import Vue from 'vue';
import VueRouter from 'vue-router';
import vueRouter from 'vue-router';
import routes from './routes'

Vue.use(vueRouter);

// 解决重复导航问题：重写push方法
const originalPush = VueRouter.prototype.push;
VueRouter.prototype.push = function push(location){
    return originalPush.call(this,location).catch(err=>err)
}

const router = new vueRouter({
    mode:'history',
    routes,
})
export default  router